package com.zaki.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {

    private Integer code; //200成功500失败
    private String msg;//success成功
    private Object data;

    public static Result success(Object data) {
        return new Result(200, "success", data);//200表示成功
    }
    public static Result success() {
        return new Result(200, "success", null);
    }
    public static Result error(String msg) {
        return new Result(500, msg, null);//500表示失败
    }
}
